package com.heer.gymnasium.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.heer.gymnasium.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by rzw2 on 2017/4/5.
 */

public class SitesReservedTimeAdapter extends ListAdapter<String> {
    public SitesReservedTimeAdapter(Context context) {
        super(context);
    }

    @Override
    public View getView(int position, View view, ViewGroup parent) {
        ViewHolder holder;
        if (view != null) {
            holder = (ViewHolder) view.getTag();
        } else {
            view = mInflater.inflate(R.layout.item_site_reserved_time, parent, false);
            holder = new ViewHolder(view);
            view.setTag(holder);
        }

        String item = getItem(position);
        holder.tvTime.setText(item + " 一");
        return view;
    }

    static class ViewHolder {
        @BindView(R.id.tv_time)
        TextView tvTime;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
